/**
 * 
 */
package sources;

import java.util.ArrayList;
import java.util.List;

import constrain.Constraint;

/**
 * @author Kyniek
 *
 */
public class EmptySource implements ISource
{
	private String dataType;
	
	private String name;
	
	private String uniueName;
	
	private List<Constraint> cons = new ArrayList<Constraint>();
	
	private static int column_ID = 0;;

	
	public EmptySource(String nam, String type)
	{
		name = nam;
		dataType = type;
		uniueName = "kol_id_" + column_ID++;	
	}
	
	
	public EmptySource(String nam, String type, String uniqNam)
	{
		name = nam;
		dataType = type;
		uniueName = uniqNam;
	}
	
	
	/* (non-Javadoc)
	 * @see sources.ISource#setDataType(java.lang.String)
	 */
	@Override
	public void setDataType(String typeName)
	{
		dataType = typeName;
	}

	
	/* (non-Javadoc)
	 * @see sources.ISource#getDataType()
	 */
	@Override
	public String getDataType()
	{
		return dataType;
	}

	
	/* (non-Javadoc)
	 * @see sources.ISource#setName(java.lang.String)
	 */
	@Override
	public void setName(String nam)
	{
		name = nam;
	}

	
	/* (non-Javadoc)
	 * @see sources.ISource#getName()
	 */
	@Override
	public String getName()
	{	
		return name;
	}

	
	/* (non-Javadoc)
	 * @see sources.ISource#setUniqueName(java.lang.String)
	 */
	@Override
	public void setUniqueName(String name)
	{
		uniueName = name;
	}

	
	/* (non-Javadoc)
	 * @see sources.ISource#getUniqueName()
	 */
	@Override
	public String getUniqueName()
	{
		return uniueName;
	}
	

	/* (non-Javadoc)
	 * @see sources.ISource#get()
	 */
	@Override
	public Object get()
	{
		return null;
	}
	

	/* (non-Javadoc)
	 * @see sources.ISource#get(int)
	 */
	@Override
	public Object[] get(int dataSize)
	{
		String[] arr = new String[dataSize];
		
//		for(int i = 0; i < arr.length; i++)
//		{
//			arr[i] = null;
//		}

		return arr;
	}


	@Override
	public String generateDeclaration()
	{
		return name + " " + dataType;
	}


	@Override
	public void setConstraint(Constraint con)
	{
		cons.clear();
		cons.add(con);
	}


	@Override
	public List<Constraint> getConstraint()
	{
		return cons;
	}


	@Override
	public void setConstraint(List<Constraint> con)
	{
		cons = con;		
	}

}
